\hypertarget{classJoyStickInterpreter}{}\doxysection{Joy\+Stick\+Interpreter Class Reference}
\label{classJoyStickInterpreter}\index{JoyStickInterpreter@{JoyStickInterpreter}}


The class serves as interface from joystick to motion controller.  




{\ttfamily \#include $<$joystick\+\_\+interpreter.\+h$>$}

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classJoyStickInterpreter_add76f0aef78793de367bdb155106d284}{Joy\+Stick\+Interpreter}} (double dt\+In)
\begin{DoxyCompactList}\small\item\em Construct a new Joy Stick Interpreter object. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_acbb8973ad5152b5a424c18f11d8d2c06}{set\+Vx\+Des\+L\+Para}} (double vx\+Des\+L\+In, double time\+To\+Reach)
\begin{DoxyCompactList}\small\item\em Set the desired vx in body frame. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_a527747a54ed75384ba6c5d1065647cbd}{set\+Vy\+Des\+L\+Para}} (double vy\+Des\+L\+In, double time\+To\+Reach)
\begin{DoxyCompactList}\small\item\em Set the desired vy in body frame. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_ada765f5a0ac381acc320f32311ce2b24}{set\+Wz\+Des\+L\+Para}} (double wz\+Des\+L\+In, double time\+To\+Reach)
\begin{DoxyCompactList}\small\item\em Set the desired omega\+\_\+z(wz) in body frame. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_a10f37ffd17dc84d82cb6f83731c5f6a1}{set\+Ini\+Pos}} (double posX, double posY)
\begin{DoxyCompactList}\small\item\em Set initial position. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_a95034121531c0693b36da5b15c45bc72}{step}} ()
\begin{DoxyCompactList}\small\item\em update the joystick command \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classJoyStickInterpreter_a5c08c43644dead1f35f6095dffabc988}{data\+Bus\+Write}} (\mbox{\hyperlink{structDataBus}{Data\+Bus}} \&data\+Bus)
\item 
void \mbox{\hyperlink{classJoyStickInterpreter_a22cff0fbc0c04060eed3a24d4e550bde}{reset}} ()
\begin{DoxyCompactList}\small\item\em reset all to 0 \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classJoyStickInterpreter_ac9a30ce112c2ca55df0e43f9d3bd1eb5}\label{classJoyStickInterpreter_ac9a30ce112c2ca55df0e43f9d3bd1eb5}} 
double \mbox{\hyperlink{classJoyStickInterpreter_ac9a30ce112c2ca55df0e43f9d3bd1eb5}{dt}}
\begin{DoxyCompactList}\small\item\em control frequency \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_ae105898be43b94218daf216692bfeff3}\label{classJoyStickInterpreter_ae105898be43b94218daf216692bfeff3}} 
double \mbox{\hyperlink{classJoyStickInterpreter_ae105898be43b94218daf216692bfeff3}{thetaZ}} \{0\}
\begin{DoxyCompactList}\small\item\em yaw angle command in body frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_a50f3f13bc710fd03b836dde7376092d5}\label{classJoyStickInterpreter_a50f3f13bc710fd03b836dde7376092d5}} 
double \mbox{\hyperlink{classJoyStickInterpreter_a50f3f13bc710fd03b836dde7376092d5}{vx\+\_\+W}} \{0\}
\begin{DoxyCompactList}\small\item\em generated velocity in x direction w.\+r.\+t world frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_a06a0a1416b12e75ef23acd9ccc4afe9b}\label{classJoyStickInterpreter_a06a0a1416b12e75ef23acd9ccc4afe9b}} 
double \mbox{\hyperlink{classJoyStickInterpreter_a06a0a1416b12e75ef23acd9ccc4afe9b}{vy\+\_\+W}} \{0\}
\begin{DoxyCompactList}\small\item\em generated velocity in y direction w.\+r.\+t world frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_ac414f96719899367d5ca73e19db4162c}\label{classJoyStickInterpreter_ac414f96719899367d5ca73e19db4162c}} 
double \mbox{\hyperlink{classJoyStickInterpreter_ac414f96719899367d5ca73e19db4162c}{px\+\_\+W}} \{0\}
\begin{DoxyCompactList}\small\item\em generated position in x direction w.\+r.\+t world frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_a8ed9e02d8397afdcc9dc9b5bd8a53da9}\label{classJoyStickInterpreter_a8ed9e02d8397afdcc9dc9b5bd8a53da9}} 
double \mbox{\hyperlink{classJoyStickInterpreter_a8ed9e02d8397afdcc9dc9b5bd8a53da9}{py\+\_\+W}} \{0\}
\begin{DoxyCompactList}\small\item\em generated position in y direction w.\+r.\+t world frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_aa15a5d96e8414866a692c201a5686674}\label{classJoyStickInterpreter_aa15a5d96e8414866a692c201a5686674}} 
double \mbox{\hyperlink{classJoyStickInterpreter_aa15a5d96e8414866a692c201a5686674}{vx\+\_\+L}} \{0\}
\begin{DoxyCompactList}\small\item\em generated linear velocity in x direction w.\+r.\+t body frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_ae90530392a244a9b3498f215a9c13d48}\label{classJoyStickInterpreter_ae90530392a244a9b3498f215a9c13d48}} 
double \mbox{\hyperlink{classJoyStickInterpreter_ae90530392a244a9b3498f215a9c13d48}{vy\+\_\+L}} \{0\}
\begin{DoxyCompactList}\small\item\em generated linear velocity in y directionw.\+r.\+t body frame \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classJoyStickInterpreter_ae5b60ab4737b0c12cbf3d32391c75039}\label{classJoyStickInterpreter_ae5b60ab4737b0c12cbf3d32391c75039}} 
double \mbox{\hyperlink{classJoyStickInterpreter_ae5b60ab4737b0c12cbf3d32391c75039}{wz\+\_\+L}} \{0\}
\begin{DoxyCompactList}\small\item\em generated angular velocity in z direction, w.\+r.\+t body frame \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The class serves as interface from joystick to motion controller. 

The class use damp trajectory to generate velocity command, (uniformly accelerated motion) 

Definition at line 18 of file joystick\+\_\+interpreter.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classJoyStickInterpreter_add76f0aef78793de367bdb155106d284}\label{classJoyStickInterpreter_add76f0aef78793de367bdb155106d284}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!JoyStickInterpreter@{JoyStickInterpreter}}
\index{JoyStickInterpreter@{JoyStickInterpreter}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{JoyStickInterpreter()}{JoyStickInterpreter()}}
{\footnotesize\ttfamily Joy\+Stick\+Interpreter\+::\+Joy\+Stick\+Interpreter (\begin{DoxyParamCaption}\item[{double}]{dt\+In }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a new Joy Stick Interpreter object. 


\begin{DoxyParams}{Parameters}
{\em dt\+In} & contorl frequency \\
\hline
\end{DoxyParams}


Definition at line 27 of file joystick\+\_\+interpreter.\+h.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classJoyStickInterpreter_a5c08c43644dead1f35f6095dffabc988}\label{classJoyStickInterpreter_a5c08c43644dead1f35f6095dffabc988}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!dataBusWrite@{dataBusWrite}}
\index{dataBusWrite@{dataBusWrite}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{dataBusWrite()}{dataBusWrite()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::data\+Bus\+Write (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structDataBus}{Data\+Bus}} \&}]{data\+Bus }\end{DoxyParamCaption})}

\begin{DoxyNote}{Note}
Currently only the x, y directions are controlled. Walking on a slope is not considered here. 
\end{DoxyNote}


Definition at line 36 of file joystick\+\_\+interpreter.\+cpp.



References Data\+Bus\+::js\+\_\+eul\+\_\+des, Data\+Bus\+::js\+\_\+omega\+\_\+des, Data\+Bus\+::js\+\_\+pos\+\_\+des, Data\+Bus\+::js\+\_\+vel\+\_\+des, px\+\_\+W, py\+\_\+W, thetaZ, vx\+\_\+W, vy\+\_\+W, and wz\+\_\+L.

\mbox{\Hypertarget{classJoyStickInterpreter_a22cff0fbc0c04060eed3a24d4e550bde}\label{classJoyStickInterpreter_a22cff0fbc0c04060eed3a24d4e550bde}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!reset@{reset}}
\index{reset@{reset}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::reset (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



reset all to 0 



Definition at line 45 of file joystick\+\_\+interpreter.\+cpp.



References Ramp\+Trajectory\+::reset\+Out(), thetaZ, vx\+\_\+L, vy\+\_\+L, and wz\+\_\+L.

\mbox{\Hypertarget{classJoyStickInterpreter_a10f37ffd17dc84d82cb6f83731c5f6a1}\label{classJoyStickInterpreter_a10f37ffd17dc84d82cb6f83731c5f6a1}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!setIniPos@{setIniPos}}
\index{setIniPos@{setIniPos}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{setIniPos()}{setIniPos()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::set\+Ini\+Pos (\begin{DoxyParamCaption}\item[{double}]{posX,  }\item[{double}]{posY }\end{DoxyParamCaption})}



Set initial position. 


\begin{DoxyParams}{Parameters}
{\em posX} & initial position in x-\/direction \\
\hline
{\em posY} & initial position in y-\/direction \\
\hline
\end{DoxyParams}


Definition at line 55 of file joystick\+\_\+interpreter.\+cpp.



References px\+\_\+W, and py\+\_\+W.

\mbox{\Hypertarget{classJoyStickInterpreter_acbb8973ad5152b5a424c18f11d8d2c06}\label{classJoyStickInterpreter_acbb8973ad5152b5a424c18f11d8d2c06}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!setVxDesLPara@{setVxDesLPara}}
\index{setVxDesLPara@{setVxDesLPara}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{setVxDesLPara()}{setVxDesLPara()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::set\+Vx\+Des\+L\+Para (\begin{DoxyParamCaption}\item[{double}]{vx\+Des\+L\+In,  }\item[{double}]{time\+To\+Reach }\end{DoxyParamCaption})}



Set the desired vx in body frame. 


\begin{DoxyParams}{Parameters}
{\em vx\+Des\+L\+In} & desired vx in body frame \\
\hline
{\em time\+To\+Reach} & reach time from now \\
\hline
\end{DoxyParams}


Definition at line 10 of file joystick\+\_\+interpreter.\+cpp.



References Ramp\+Trajectory\+::set\+Para().

\mbox{\Hypertarget{classJoyStickInterpreter_a527747a54ed75384ba6c5d1065647cbd}\label{classJoyStickInterpreter_a527747a54ed75384ba6c5d1065647cbd}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!setVyDesLPara@{setVyDesLPara}}
\index{setVyDesLPara@{setVyDesLPara}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{setVyDesLPara()}{setVyDesLPara()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::set\+Vy\+Des\+L\+Para (\begin{DoxyParamCaption}\item[{double}]{vy\+Des\+L\+In,  }\item[{double}]{time\+To\+Reach }\end{DoxyParamCaption})}



Set the desired vy in body frame. 


\begin{DoxyParams}{Parameters}
{\em vy\+Des\+L\+In} & desired vy in body frame \\
\hline
{\em time\+To\+Reach} & reach time from now \\
\hline
\end{DoxyParams}


Definition at line 14 of file joystick\+\_\+interpreter.\+cpp.



References Ramp\+Trajectory\+::set\+Para().

\mbox{\Hypertarget{classJoyStickInterpreter_ada765f5a0ac381acc320f32311ce2b24}\label{classJoyStickInterpreter_ada765f5a0ac381acc320f32311ce2b24}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!setWzDesLPara@{setWzDesLPara}}
\index{setWzDesLPara@{setWzDesLPara}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{setWzDesLPara()}{setWzDesLPara()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::set\+Wz\+Des\+L\+Para (\begin{DoxyParamCaption}\item[{double}]{wz\+Des\+L\+In,  }\item[{double}]{time\+To\+Reach }\end{DoxyParamCaption})}



Set the desired omega\+\_\+z(wz) in body frame. 


\begin{DoxyParams}{Parameters}
{\em wz\+Des\+L\+In} & desired wz in body frame \\
\hline
{\em time\+To\+Reach} & reach time from now \\
\hline
\end{DoxyParams}


Definition at line 18 of file joystick\+\_\+interpreter.\+cpp.



References Ramp\+Trajectory\+::set\+Para().

\mbox{\Hypertarget{classJoyStickInterpreter_a95034121531c0693b36da5b15c45bc72}\label{classJoyStickInterpreter_a95034121531c0693b36da5b15c45bc72}} 
\index{JoyStickInterpreter@{JoyStickInterpreter}!step@{step}}
\index{step@{step}!JoyStickInterpreter@{JoyStickInterpreter}}
\doxysubsubsection{\texorpdfstring{step()}{step()}}
{\footnotesize\ttfamily void Joy\+Stick\+Interpreter\+::step (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



update the joystick command 



Definition at line 22 of file joystick\+\_\+interpreter.\+cpp.



References dt, px\+\_\+W, py\+\_\+W, Ramp\+Trajectory\+::step(), thetaZ, vx\+\_\+L, vx\+\_\+W, vy\+\_\+L, vy\+\_\+W, and wz\+\_\+L.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
joystick\+\_\+interpreter.\+h\item 
joystick\+\_\+interpreter.\+cpp\end{DoxyCompactItemize}
